<table  border="0" cellspacing="0" cellpadding="0" class="from_table_2" style=" margin-left:10px;">
 
  <tr>
    <th width="110" style=" color:#007dc6; *padding-top:5px;" ><tpl> $langLinkInTypeLook </tpl>：</th>
    <td width="575"><select name="select_type" onchange="ajax_select(this.value);">
	<option value="0" <tpl> if $select_type eq '0' </tpl>selected="selected"<tpl> /if </tpl>><tpl> $langLinkImage </tpl></option>
	<option value="1" <tpl> if $select_type eq '1' </tpl>selected="selected"<tpl> /if </tpl>><tpl> $langLinkWord </tpl></option>
</select> <tpl> $langLinkExplainHomeDisSort </tpl></td>
  </tr>
   <tr style="height:1px;background-color: #E6F5FF;">
      
      </tr>
</table>
<form action="link.manage.php" id="form_del" name="form_del" method="post" style="padding-bottom:20px">
	<input type="hidden" name="action" id="action" />
    <table class="from_table2_one top-1">
	 <thead>
	  <tr class="area_ajax_list_title">
	    <th class="pd-left" width="50"><tpl> $langLinkSelect </tpl></th>	
	      <th width="100"><tpl> $langLinkImage </tpl></th>
        <th width="100"><tpl> $langLinkTopic </tpl></th>
	    <th width="250"><tpl> $langLinkJump </tpl></th>
	    <th width="50"><tpl> $langLinkEstate </tpl></th>
		  <th width="50"><tpl> $langCSort </tpl></th>
		  <th width="50"><tpl> $langCOperation </tpl></th>
      </tr>
	  </thead>
	  <tpl> if $link_array[0].link_id neq '' </tpl>
		  <tpl> section name=i loop=$link_array </tpl>
		  <tr>
		    <td class="pd-left" width="50"><input name="link_id[]" type="checkbox" value="<tpl> $link_array[i].link_id </tpl>"/></td>	
			  <td width="100"><tpl> if $link_array[i].link_pic neq '' </tpl><img src="<tpl> $site_url </tpl>/<tpl> $link_array[i].link_pic </tpl>" border="0" style="vertical-align:middle; margin-left:10px;margin-right:10px; width:<tpl> $link_info.pic_width </tpl>px; height:<tpl> $link_info.pic_height </tpl>px" /><tpl> /if </tpl></td>
		    <td width="100"><tpl> $link_array[i].link_title </tpl></td>
			  <td width="250"><a target="_blank" href="<tpl> $link_array[i].link_url </tpl>">
		    <tpl> $link_array[i].link_url|truncate:'30' </tpl></a></td>
			  <td width="50">
			  	<tpl> if $link_array[i].link_close eq '0' </tpl>
			  		<tpl> $langCOpen </tpl>
				<tpl> else if $link_array[i].link_close eq '1' </tpl>
					<tpl> $langCClose </tpl>
				<tpl> /if </tpl>
		    </td>
			  <td width="50"><tpl> $link_array[i].link_sort|default:'0' </tpl></td>
			  <td width="50">
			  	<a href="javascript:;" onclick="hideMessage();ajax_modi('<tpl> $link_array[i].link_id </tpl>');" title="<tpl> $langCedit </tpl>" class="edit_a_pic">
			  	</a> 
			</td>
		  </tr>
		  <tpl> /section </tpl>
		 
		  <tpl> else  </tpl>
		  <tr>
			<td colspan="7"><tpl> $langLinkNotContent </tpl></td>
		  </tr>
		<tpl> /if </tpl>
  </table>
  <tpl> if $link_array[0].link_id neq '' </tpl>
  <div class="table-5-bottom">
  <div class="p-left">
				<span class="btn_left"><input style=" font:12px/1.2em '宋体'" name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langLinkAllSelect </tpl>" /></span>
				<span class="btn_left"> <input style=" font:12px/1.2em '宋体'; " name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langLinkContrarySelect </tpl>" /></span>
				<span class="btn_left"><input  style=" font:12px/1.2em '宋体'; " type="button" id="openbutton" class="btn_submit" name="openbutton" value="<tpl> $langLinkOpenDis </tpl>" /></span>
				<span class="btn_left"><input  style=" font:12px/1.2em '宋体'; " type="button" id="closebutton" class="btn_submit" name="closebutton" value="<tpl> $langLinkCloseDis </tpl>" /></span>
				<span class="btn_left"><input  style=" font:12px/1.2em '宋体'; " type="button" id="delbutton" class="btn_submit" name="delbutton" value="<tpl> $langLinkDeleteSelect </tpl>" /></span>
			  </div>
				<div style="float:right; padding-right:20px">
				<tpl> $page_list </tpl>		
				</div>
  </div>
  <tpl> /if </tpl>
</form>
<div id="question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-

top:10px; padding-bottom:10px"><tpl> $langLinkConfirmDelete </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid 

#CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; 

margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
		<input type="hidden" id="del_value" />
</div> 
<script type="text/javascript">
$(document).ready(function() {	
	$('#negative').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
	);
	$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	//删除操作
	var options_del = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("link.manage.php?action=ajax_list&select_type="+<tpl> $select_type </tpl>);
						}
					},
		type:      'post',
		dataType:  'json'
	};
	
	var question = $('#question')[0];
	$("#delbutton").click(function(){
		$('#action').val('del');
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
			$.unblockUI();
			$('#form_del').ajaxSubmit(options_del);	
			return false;
		});
	$('#no').click($.unblockUI);
	
	//关闭操作
	var options_close = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("link.manage.php?action=ajax_list&select_type="+<tpl>$select_type</tpl>);
						}
					},
		type:      'post',
		dataType:  'json'
	};
	$("#closebutton").click(function(){
		$('#action').val('close');
		$('#form_del').ajaxSubmit(options_close);	
	});
	
	//开启操作
	var options_open = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("link.manage.php?action=ajax_list&select_type="+<tpl>$select_type</tpl>);
						}
					},
		type:      'post',
		dataType:  'json'
	};
	$("#openbutton").click(function(){
		$('#action').val('open');
		$('#form_del').ajaxSubmit(options_open);	
	});
});	

//编辑
function ajax_modi(id){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("link.manage.php?action=modi&link_id="+id+"&select_type="+<tpl>$select_type</tpl>);
}


//显示类型跳转
function ajax_select(str){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("link.manage.php?action=ajax_list&select_type="+str);
}



</script>